﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.talent.entity;

import javax.validation.constraints.NotNull;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.hh.bss.base.BaseEntity;
import com.hh.bss.util.DateConvertUtils;



public class CvWork extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "CvWork";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_CV_ID = "cvId";
	public static final String ALIAS_BEGIN_D = "beginD";
	public static final String ALIAS_END_D = "endD";
	public static final String ALIAS_COMPANY = "company";
	public static final String ALIAS_COMPANY_EN = "companyEn";
	public static final String ALIAS_TITLE = "title";
	public static final String ALIAS_TITLE_EN = "titleEn";
	public static final String ALIAS_REPORT_TITLE = "reportTitle";
	public static final String ALIAS_REPORT_TITLE_EN = "reportTitleEn";
	public static final String ALIAS_TEAM_SIZE = "teamSize";
	public static final String ALIAS_PRODUCT_SIZE = "productSize";
	public static final String ALIAS_PRODUCT_LEVEL_EN = "productLevelEn";
	public static final String ALIAS_DUTY_SIZE = "dutySize";
	public static final String ALIAS_DUTY_SIZE_EN = "dutySizeEn";
	public static final String ALIAS_DUTY_DESC = "dutyDesc";
	public static final String ALIAS_DUTY_DESC_EN = "dutyDescEn";
	public static final String ALIAS_SCORE = "score";
	public static final String ALIAS_SCORE_EN = "scoreEn";
	public static final String ALIAS_LEAVE_RESULT = "leaveResult";
	public static final String ALIAS_LEAVE_RESULT_EN = "leaveResultEn";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIER = "modifier";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";
	public static final String ALIAS_IS_ENG = "isEng";
	
	//date formats
	public static final String FORMAT_BEGIN_D = SHORT_DATE_FORMAT;
	public static final String FORMAT_END_D = SHORT_DATE_FORMAT;
	public static final String FORMAT_CREATE_DT = DATE_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotNull 
	private java.lang.Integer cvId;
	@NotNull 
	private java.util.Date beginD;
	
	private java.util.Date endD;
	@NotBlank @Length(max=200)
	private java.lang.String company;
	@Length(max=200)
	private java.lang.String companyEn;
	@Length(max=200)
	private java.lang.String title;
	@Length(max=200)
	private java.lang.String titleEn;
	@Length(max=200)
	private java.lang.String reportTitle;
	@Length(max=200)
	private java.lang.String reportTitleEn;
	
	private java.lang.Integer teamSize;
	@Length(max=65535)
	private java.lang.String productSize;
	@Length(max=65535)
	private java.lang.String productLevelEn;
	@Length(max=65535)
	private java.lang.String dutySize;
	@Length(max=65535)
	private java.lang.String dutySizeEn;
	@Length(max=65535)
	private java.lang.String dutyDesc;
	@Length(max=65535)
	private java.lang.String dutyDescEn;
	@Length(max=65535)
	private java.lang.String score;
	@Length(max=65535)
	private java.lang.String scoreEn;
	@Length(max=65535)
	private java.lang.String leaveResult;
	@Length(max=65535)
	private java.lang.String leaveResultEn;
	@Length(max=50)
	private java.lang.String creator;
	
	private java.util.Date createDt;
	@Length(max=50)
	private java.lang.String modifier;
	
	private java.util.Date modifiedDt;
	//columns END
	private String isEng="0";

	public CvWork(){
	}

	public CvWork(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setCvId(java.lang.Integer value) {
		this.cvId = value;
	}
	
	public java.lang.Integer getCvId() {
		return this.cvId;
	}
	public String getBeginDString() {
		return DateConvertUtils.format(getBeginD(), FORMAT_BEGIN_D);
	}
	public String getBeginSDString() {
		return DateConvertUtils.format(getBeginD(), SHORT_DATE_FORMAT);
	}
	public void setBeginDString(String value) {
		setBeginD(DateConvertUtils.parse(value, FORMAT_BEGIN_D,java.util.Date.class));
	}
	
	public void setBeginD(java.util.Date value) {
		this.beginD = value;
	}
	
	public java.util.Date getBeginD() {
		return this.beginD;
	}
	public String getEndDString() {
		return DateConvertUtils.format(getEndD(), FORMAT_END_D);
	}
	public String getEndSDString() {
		return DateConvertUtils.format(getEndD(), SHORT_DATE_FORMAT);
	}
	public void setEndDString(String value) {
		setEndD(DateConvertUtils.parse(value, FORMAT_END_D,java.util.Date.class));
	}
	
	public void setEndD(java.util.Date value) {
		this.endD = value;
	}
	
	public java.util.Date getEndD() {
		return this.endD;
	}
	public void setCompany(java.lang.String value) {
		this.company = value;
	}
	
	public java.lang.String getCompany() {
		return this.company;
	}
	public void setCompanyEn(java.lang.String value) {
		this.companyEn = value;
	}
	
	public java.lang.String getCompanyEn() {
		return this.companyEn;
	}
	public void setTitle(java.lang.String value) {
		this.title = value;
	}
	
	public java.lang.String getTitle() {
		return this.title;
	}
	public void setTitleEn(java.lang.String value) {
		this.titleEn = value;
	}
	
	public java.lang.String getTitleEn() {
		return this.titleEn;
	}
	public void setReportTitle(java.lang.String value) {
		this.reportTitle = value;
	}
	
	public java.lang.String getReportTitle() {
		return this.reportTitle;
	}
	public void setReportTitleEn(java.lang.String value) {
		this.reportTitleEn = value;
	}
	
	public java.lang.String getReportTitleEn() {
		return this.reportTitleEn;
	}
	public void setTeamSize(java.lang.Integer value) {
		this.teamSize = value;
	}
	
	public java.lang.Integer getTeamSize() {
		return this.teamSize;
	}
	public void setProductSize(java.lang.String value) {
		this.productSize = value;
	}
	
	public java.lang.String getProductSize() {
		return this.productSize;
	}
	public void setProductLevelEn(java.lang.String value) {
		this.productLevelEn = value;
	}
	
	public java.lang.String getProductLevelEn() {
		return this.productLevelEn;
	}
	public void setDutySize(java.lang.String value) {
		this.dutySize = value;
	}
	
	public java.lang.String getDutySize() {
		return this.dutySize;
	}
	public void setDutySizeEn(java.lang.String value) {
		this.dutySizeEn = value;
	}
	
	public java.lang.String getDutySizeEn() {
		return this.dutySizeEn;
	}
	public void setDutyDesc(java.lang.String value) {
		this.dutyDesc = value;
	}
	
	public java.lang.String getDutyDesc() {
		return this.dutyDesc;
	}
	public void setDutyDescEn(java.lang.String value) {
		this.dutyDescEn = value;
	}
	
	public java.lang.String getDutyDescEn() {
		return this.dutyDescEn;
	}
	public void setScore(java.lang.String value) {
		this.score = value;
	}
	
	public java.lang.String getScore() {
		return this.score;
	}
	public void setScoreEn(java.lang.String value) {
		this.scoreEn = value;
	}
	
	public java.lang.String getScoreEn() {
		return this.scoreEn;
	}
	public void setLeaveResult(java.lang.String value) {
		this.leaveResult = value;
	}
	
	public java.lang.String getLeaveResult() {
		return this.leaveResult;
	}
	public void setLeaveResultEn(java.lang.String value) {
		this.leaveResultEn = value;
	}
	
	public java.lang.String getLeaveResultEn() {
		return this.leaveResultEn;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	
	
	public String getIsEng() {
		return isEng;
	}

	public void setIsEng(String isEng) {
		this.isEng = isEng;
	}

	public java.lang.String getCreator() {
		return this.creator;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}
	public void setModifier(java.lang.String value) {
		this.modifier = value;
	}
	
	public java.lang.String getModifier() {
		return this.modifier;
	}
	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}
	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT,java.util.Date.class));
	}
	
	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}
	
	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("CvId",getCvId())
			.append("BeginD",getBeginD())
			.append("EndD",getEndD())
			.append("Company",getCompany())
			.append("CompanyEn",getCompanyEn())
			.append("Title",getTitle())
			.append("TitleEn",getTitleEn())
			.append("ReportTitle",getReportTitle())
			.append("ReportTitleEn",getReportTitleEn())
			.append("TeamSize",getTeamSize())
			.append("ProductSize",getProductSize())
			.append("ProductLevelEn",getProductLevelEn())
			.append("DutySize",getDutySize())
			.append("DutySizeEn",getDutySizeEn())
			.append("DutyDesc",getDutyDesc())
			.append("DutyDescEn",getDutyDescEn())
			.append("Score",getScore())
			.append("ScoreEn",getScoreEn())
			.append("LeaveResult",getLeaveResult())
			.append("LeaveResultEn",getLeaveResultEn())
			.append("Creator",getCreator())
			.append("CreateDt",getCreateDt())
			.append("Modifier",getModifier())
			.append("ModifiedDt",getModifiedDt())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof CvWork == false) return false;
		if(this == obj) return true;
		CvWork other = (CvWork)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

